package com.jp.knowledge.my.adapter;

import android.content.Context;
import android.support.annotation.NonNull;

import com.jp.knowledge.R;
import com.jp.knowledge.my.base.RecycleVAdapter;
import com.jp.knowledge.my.base.RecycleVHolder;
import com.jp.knowledge.my.model.MyReeceModel;

import java.util.List;

/**
 * @author gzejia 978862664@qq.com
 */
public class MyReeceAdapter extends RecycleVAdapter<MyReeceModel> {

    public MyReeceAdapter(Context context, @NonNull List<MyReeceModel> list) {
        super(context, list);
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_my_reece;
    }

    @Override
    public void onBind(RecycleVHolder holder, int position) {
        MyReeceModel model = getData(position);
        holder.setTextView(R.id.item_reece_tv_week, model.getDate());
        holder.setTextView(R.id.item_reece_tv_time, model.getTime());
        holder.setImageResource(R.id.item_reece_iv, model.getHeaderUrl());
        holder.setTextView(R.id.item_reece_tv_value, String.valueOf(model.getMoney()));
        holder.setTextView(R.id.item_reece_tv_hind, model.getHind());
    }
}
